﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using PaydSystem.Cls;

namespace PaydSystem.Common
{
    public class Fn
    {
        public void ClearSession()
        {
            HttpContext.Current.Session["UserAuthentication"] = null;
            HttpContext.Current.Session.Abandon();
            HttpContext.Current.Session.Clear();
            HttpContext.Current.Session.Contents.RemoveAll();
            FormsAuthentication.SignOut();
            HttpContext.Current.User = null;
        }

        

        public void CreatePaydUserSession(PaydUserCls paydUser, string password)
        {
            HttpContext.Current.Session["UserAuthentication"] = paydUser.MemberId;
            FormsAuthentication.Authenticate(paydUser.MemberId.ToString(), password);
        }
    }
}